# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
class Category(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=20)
    summary = models.CharField(max_length=50)
    status = models.IntegerField()
    remark = models.CharField(max_length=50, blank=True, null=True)
    create_user = models.ForeignKey('Users', models.DO_NOTHING, db_column='create_user')
    create_time = models.DateTimeField()
    update_user = models.ForeignKey('Users', models.DO_NOTHING, db_column='update_user')
    update_time = models.DateTimeField()

    class Meta:
        managed = True
        db_table = 'category'


class Sections(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=20)
    summary = models.CharField(max_length=50)
    videos = models.ForeignKey('Videos', models.DO_NOTHING)
    teacher = models.ForeignKey('Users', models.DO_NOTHING)
    video_length = models.SmallIntegerField()
    url = models.CharField(max_length=100)
    cover = models.CharField(max_length=100)
    hit = models.IntegerField()
    status = models.IntegerField()
    remark = models.CharField(max_length=50, blank=True, null=True)
    create_user = models.ForeignKey('Users', models.DO_NOTHING, db_column='create_user')
    create_time = models.DateTimeField()
    update_user = models.ForeignKey('Users', models.DO_NOTHING, db_column='update_user')
    update_time = models.DateTimeField()

    class Meta:
        managed = True
        db_table = 'sections'


class Users(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=20)

    class Meta:
        managed = True
        db_table = 'users'


class Videos(models.Model):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=20)
    summary = models.CharField(max_length=50)
    category = models.ForeignKey(Category, models.DO_NOTHING)
    status = models.IntegerField()
    remark = models.CharField(max_length=50, blank=True, null=True)
    create_user = models.ForeignKey(Users, models.DO_NOTHING, db_column='create_user')
    create_time = models.DateTimeField()
    update_user = models.ForeignKey(Users, models.DO_NOTHING, db_column='update_user')
    update_time = models.DateTimeField()

    class Meta:
        managed = True
        db_table = 'videos'

# Create your models here.
